package com.evony.common.server.events 
{
    import com.evony.common.*;
    import com.evony.common.beans.*;
    import mx.collections.*;
    
    public class DeclaredWarUpdate extends com.evony.common.BaseBean
    {
        public function DeclaredWarUpdate(arg1:String, arg2:Object, arg3:Boolean=false, arg4:Boolean=false)
        {
            var loc1:*=0;
            var loc2:*=null;
            declaredWarBeansArray = new mx.collections.ArrayCollection();
            super(arg1, arg3, arg4);
            if (arg2.declaredWarBeans) 
            {
                loc1 = 0;
                while (loc1 < arg2.declaredWarBeans.length) 
                {
                    loc2 = new com.evony.common.beans.PlayerDeclaredWarBean(arg2.declaredWarBeans[loc1]);
                    this.declaredWarBeansArray.addItem(loc2);
                    ++loc1;
                }
            }
            return;
        }

        public function copyTo(arg1:com.evony.common.server.events.DeclaredWarUpdate):void
        {
            com.evony.common.CommonUtil.arrayCopy(this.declaredWarBeansArray, arg1.declaredWarBeansArray);
            return;
        }

        public function setDeclaredWarBeans(arg1:com.evony.common.beans.PlayerDeclaredWarBean, arg2:int):void
        {
            this.declaredWarBeansArray[arg2] = arg1;
            return;
        }

        public override function toDebugString(arg1:String=""):String
        {
            var loc1:*=0;
            var loc2:*="---- DeclaredWarUpdate ----\n";
            loc1 = 0;
            while (loc1 < this.declaredWarBeansArray.length) 
            {
                loc2 = loc2 + this.getDeclaredWarBeans(loc1).toDebugString(arg1 + "declaredWarBeans[" + loc1 + "].");
                ++loc1;
            }
            return loc2;
        }

        public function toObject():Object
        {
            var loc1:*=new Object();
            return loc1;
        }

        public function getDeclaredWarBeans(arg1:int):com.evony.common.beans.PlayerDeclaredWarBean
        {
            var loc1:*=this.declaredWarBeansArray[arg1] as com.evony.common.beans.PlayerDeclaredWarBean;
            return loc1;
        }

        public var declaredWarBeansArray:mx.collections.ArrayCollection;
    }
}
